% 作者：何光辉,
% 邮箱：flamehe@163.com
x  = ExpandedChebyshev(20);
% Ten grid points in [-1,1] using distribution of ExpandedChebyshev
f  = sin(2*x);
f1 = 2*cos(2*x);
f2 = -4*sin(2*x);
f3 = -8*cos(2*x);

cij = DQCoeff(x, 3);

error1 = cij(:,:,1)*f - f1;
error2 = cij(:,:,2)*f - f2;
error3 = cij(:,:,3)*f - f3;
s1=sprintf('first order derivative error  = %.6e', norm(error1));
s2=sprintf('second order derivative error = %.6e', norm(error2));
s3=sprintf('second order derivative error = %.6e', norm(error3));
disp(s1)
disp(s2)
disp(s3)